
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">

    <script src="/static/js/jquery-3.3.1.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column" style="height: 200px;">
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="row clearfix">
                <div class="col-md-4 column">
                </div>
                <div class="col-md-4 column">
                    <span style="color: red;">${msg}</span>
                    <form class="form-horizontal" role="form" action="/user/register"
                          method="post" onsubmit="return valid_submit()">
                        <label>用户名</label>
                        <input class="form-control" name="username">
                        <br>
                        <label>密码</label>
                        <input type="password" class="form-control" name="password">
                        <br>
                        <label>确认密码</label>
                        <input type="password" class="form-control" id="repass">
                        <br>
                        <input type="submit" class="btn btn-primary btn-block" value="注册">

                    </form>
                </div>
                <div class="col-md-4 column">
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function valid_submit() {
        var username = $("input[name='username']").val();
        var password = $("input[name='password']").val();
        var repass = $("#repass").val();

        if(username != "" && password != "" && password == repass){
            return true;
        }else{
            return false;
        }
    }
</script>
</html>